#include <stdio.h>
#include "game.h"

int main(void)
{
	int n = 0,m = 0;
	printf("请输入小朋友的数量，出列的号码:");
	scanf("%d%d",&n,&m);
	if(n < 1 && m < 1)
	{
		puts("请输入有效的号码!");
		return -1;
	}
	NODE* head = NULL;
	register int i = 1;
	for(; i <= n; i++)
	{
		sclist_add(&head,i);
	}

	int num = 0;
	while(sclist_delete(&head,m,&num) == 0);
	
	printf("最后一个小朋友的编号是:%d\n",num);

//	sclist_free(&head);
	return 0;
}
